// Copyright (c) 2002 HTHK
//******************************************************************/
//Modification History
//******************************************************************/
//CR log no 1266: By Ploy Li on 2004-04-27
//******************************************************************/

package com.system.userMultiRole;

import com.ffpc.sql.*;

import java.sql.*;
import java.util.Vector;

/**
 * A Class class.
 * <P>
 * @author HTHK
 */
public class UserMultiRoleProcess
{
    public static UserMultiRoleBean createBean()
    {
        return new UserMultiRole();
    }

    public static int insert(Connection con, UserMultiRoleBean userBean)
      throws DataException
    {
        UserMultiRole userRole = (UserMultiRole)userBean;
        userRole.setConnection(con);
        return userRole.insert();
    }

    public static int update(Connection con, UserMultiRoleBean userBean)
      throws DataException
    {

        System.out.println("UserMultiRoleProcess.java for test");
        UserMultiRole userRole = (UserMultiRole)userBean;
        userRole.setConnection(con);
        return userRole.update();
    }

    public static int delete(Connection con, UserMultiRoleBean userBean)
      throws DataException
    {
        UserMultiRole userRole = (UserMultiRole)userBean;
        userRole.setConnection(con);
        return userRole.delete();
    }

    public static UserMultiRoleBean[] find(Connection con, UserMultiRoleBean userBean)
      throws DataException
    {
        UserMultiRole userRole = (UserMultiRole)userBean;
        BaseSqlCommand buc = new BaseSqlCommand(con);
        Vector rows = buc.find(userRole);
        UserMultiRoleBean[] beans = new UserMultiRole[rows.size()];
        for (int i=0;i<rows.size();i++)
        {
            UserMultiRole bean = new UserMultiRole();
            bean.setColumns((Column[])rows.get(i));
            beans[i] = bean;
        }
        return beans;
    }
}


